﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using zhangmenren.IService;
using zhangmenren.Models;
using zhangmenren.Repository;

namespace zhangmenren.Service
{
    public class CommentService : ICommentServic
    {
        private CommentRepository commentRepository = new CommentRepository();

        public Task<int> Add(CommentEntity entity)
        {
            return Task.FromResult(commentRepository.Add(entity));
        }

		public Task<int> Del(int id)
		{
			return Task.FromResult(commentRepository.Del(id));
		}

		public Task<IEnumerable<CommentEntity>> FindByWorkId(int workId)
        {
            return Task.FromResult(commentRepository.FindByWorkId(workId));
        }

        public Task<IEnumerable<CommentEntity>> FindByZMId(int zmid)
        {
            return Task.FromResult(commentRepository.FindByZMId(zmid));
        }

       


        public Task<IEnumerable<CommentEntity>> Select()
		{
			return Task.FromResult(commentRepository.Select());
		}

        public Task<int> Up(int id, string up)
        {
            return Task.FromResult(commentRepository.Up(id,up));
        }
    }
}
